/*
 * fractor.h
 *
 *  Created on: 2015-5-3
 *      Author: ZHAO Jing
 */

#ifndef FRACTOR_H_
#define FRACTOR_H_

typedef struct {
	int up;
	int down;
} FRACTOR;

void init(FRACTOR *f);
void print(FRACTOR *f);
void setUp(FRACTOR *f,int newUp);
void setDown(FRACTOR *f,int newDown);
void setUpDown(FRACTOR *,int ,int);
void simplify(FRACTOR *f);

void setMinus(FRACTOR *f);
void setReverse(FRACTOR *f);

void add(FRACTOR *,FRACTOR *,FRACTOR*);
void sub(FRACTOR *,FRACTOR *,FRACTOR*);
void mul(FRACTOR *,FRACTOR *,FRACTOR*);
void div(FRACTOR *,FRACTOR *,FRACTOR*);

int cmp(const FRACTOR* a,const FRACTOR *b);
#endif /* FRACTOR_H_ */
